import { ajax } from "@/config/apiServer/axios-config.js";
import { URLS } from "@/config/apiServer/urls.js";

// 支持币种列表
export function supTokens() {
  return ajax({
    type: "get",
    url: URLS.FLASH_SUP_TOKEN
  });
}

// 获取交易对列表
export function getTokens(platform_id) {
  return ajax({
    type: "get",
    typeData: true,
    url: URLS.FLASH_TOKEN_LIST,
    params: {
      platform_id
    }
  });
}

// 添加交易对
export function addTokenPairs(param) {
  return ajax({
    type: "post",
    url: URLS.FLASH_TOKEN_OPERATE,
    params: param
  });
}

// 删除交易对
export function delTokenPairs(param) {
  return ajax({
    type: "DELETE",
    url: URLS.FLASH_TOKEN_OPERATE,
    params: param
  });
}

// 更新交易对
export function updateTokenPairs(param) {
  return ajax({
    type: "PUT",
    url: URLS.FLASH_TOKEN_OPERATE,
    params: param
  });
}

// 获取交易对行情
export function getCoinsPrice(param) {
  return ajax({
    type: "post",
    url: URLS.COIN_PRICE,
    params: param
  });
}

// 获取交易所列表
export function getTradeSup() {
  return ajax({
    type: "get",
    url: URLS.FLASH_TRADE_SUP
  });
}
